//
//  MyBankCardViewController.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/12.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "MyBankCardViewController.h"
#import "MyBankCardView.h"
#import "ReceiptCardView.h"
#import "TopView.h"
#import "AddCreditCardViewController.h"
#import "MyBankCardTableViewCell.h"
#import "UIView+AZGradient.h"
#import "AddNewCardView.h"
#import "ChangeReceiptCardViewController.h"
#import "SelectCreditCardModelPack.h"
#import "DeleteCredictCardModelPack.h"
#import <Masonry.h>
#import "ChangeReceiptCardViewController.h"
#import "GetReceiptCardModelPack.h"
#import "H5TradeViewController.h"


@interface MyBankCardViewController ()<UIScrollViewDelegate,UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)MyBankCardView *mv;
@property(nonatomic,strong)ReceiptCardView *rv;
@property(nonatomic,strong)TopView *tv;

@property(nonatomic,strong)UIScrollView *scrollView;
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)AddNewCardView *addNewCardView;

//模型数组
@property(nonatomic,strong)NSMutableArray *cardModelArray;

//传值到修改收款卡

/**
 银行预留手机号
 */
@property(nonatomic,strong)NSString *bankPhoneNumStr;

/**
 银行卡号
 */
@property(nonatomic,strong)NSString *bankCardNumStr;

/**
 银行简称
 */
@property(nonatomic,strong)NSString *bankCodeStr;

/**
 银行名称
 */
@property(nonatomic,strong)NSString *bankNameStr;


/**
 银行卡ID
 */
@property(nonatomic,strong)NSString *commMercIdStr;


/**
 在线申请信用卡
 */
@property(nonatomic,strong)UIButton *onlineApplyCreditCardBtn;

@end

@implementation MyBankCardViewController


-(NSMutableArray *)cardModelArray
{
    if (_cardModelArray == nil) {
        _cardModelArray = [NSMutableArray array];
    }
    return _cardModelArray;
}


-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}
-(void)getCredictCardList
{
    NSString *url = [[ServerAddressModel shareInstance] fullTAnd0AddrWithParameter:@"/epay_apps/creditCard/showCreditCards"];
    [[ETONEHttpClient sharedInstance] doHTTPSPOST:url Parameters:nil HttpBody:nil SuccessHandler:^(id responseObject) {
        
        NSDictionary *dic = [responseObject mj_JSONObject];
        NSString *code = dic[@"code"];
        if ([@"0000" isEqualToString:code]) {
         
            [self dealCredictCardList:responseObject];
            
        }
        
    } FailedHandler:^(NSError *error) {
        
        self.onlineApplyCreditCardBtn.hidden = NO;
        
    }];
    
}
-(void)dealCredictCardList:(id)responseObject
{
    //清空数组
    [self.cardModelArray removeAllObjects];
    
    SelectCreditCardResponse *selectResponse = [SelectCreditCardResponse mj_objectWithKeyValues:responseObject];
    
    if (selectResponse.response.cardList.count == 0) {
        self.onlineApplyCreditCardBtn.hidden = NO;
    }else
    {
        self.onlineApplyCreditCardBtn.hidden = YES;
    }
    
    for (SelectCreditCardRecord *record in selectResponse.response.cardList) {
        [self.cardModelArray addObject:record];
    }
    [self.tableView reloadData];
}

-(void)deleteCredictCardWithCardNo:(NSString *)cardNo Model:(SelectCreditCardRecord*)record
{
    DeleteCredictCardRequest *request = [[DeleteCredictCardRequest alloc] init];
    request.ID = cardNo;
    NSDictionary *dic = [request mj_keyValues];
    NSString *url = [[ServerAddressModel shareInstance] fullTAnd0AddrWithParameter:@"/epay_apps/creditCard/deleteCreditCard"];
    [[ETONEHttpClient sharedInstance] doHTTPSPOST:url Parameters:dic HttpBody:nil SuccessHandler:^(id responseObject) {
        
        NSDictionary *dic = [responseObject mj_JSONObject];
        NSString *code = dic[@"code"];
        if ([@"0000" isEqualToString:code]) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                [self showSuccessResultTips:@"删除成功" animated:YES forSeconds:SUCCESS_SHOW_TIME_DEF completionBlock:^{
                    [self dealDeleteCredictCard:responseObject Model:record];
                }];
            });
            
            
        }
        
        
    } FailedHandler:^(NSError *error) {
        
    }];
}
-(void)dealDeleteCredictCard:(id)responseObject Model:(SelectCreditCardRecord*)record
{
    //删除成功之后  把本地数组删除对应的模型  更新tableView
    
    //支付卡-1
    NSInteger num = [[AppTools shareInstance].userInfo.creditCardNum integerValue] - 1;
    [AppTools shareInstance].userInfo.creditCardNum = [NSString stringWithFormat:@"%ld",(long)num];
    
    /*/
    //把登录返回的数据模型存储到本地
    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:[AppTools shareInstance].userInfo];
    [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"u"];
     */
    
    [self.cardModelArray removeObject:record];
    
    if (self.cardModelArray.count == 0) {
        self.onlineApplyCreditCardBtn.hidden = NO;
    }
    
    dispatch_async(dispatch_get_main_queue(), ^{
        [self.tableView reloadData];
    });
    
}



- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的银行卡";
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    //创建topView
    [self createTopView];
    
    //创建scrollView
    [self createScrollView];
    
    //创建支付卡View
//    [self createPayCardView];
    //创建收款卡View
    [self createreceiptView];
    //初始状态
    [self payBtnAction];
    
    [self.tv.payBtn addTarget:self action:@selector(payBtnAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.tv.receiptBtn addTarget:self action:@selector(receiptBtnAction) forControlEvents:(UIControlEventTouchUpInside)];
    
    //解决手势冲突
    [self solveConfict];
    
    //点击添加新卡
    [self.mv.addCardBtn addTarget:self action:@selector(addNewCard) forControlEvents:(UIControlEventTouchUpInside)];
    
    //创建tableView
    [self createTableView];
    
    //获取支付卡列表
    [self getCredictCardList];
    //获取收款卡
    self.rv.bankCardView.hidden = YES;
    [self getReceiptCard];
}
-(void)getReceiptCard
{
    NSString *url = [[ServerAddressModel shareInstance] fullTAnd0AddrWithParameter:@"/epay_apps/user/userInfoE0100"];
    [[ETONEHttpClient sharedInstance] doHTTPSPOSTNOTips:url Parameters:nil HttpBody:nil SuccessHandler:^(id responseObject) {
        
        NSDictionary *dic = [responseObject mj_JSONObject];
        NSString *code = dic[@"code"];
        if ([@"0000" isEqualToString:code]) {
            [self dealGetReceiptWith:responseObject];
        }
        
    } FailedHandler:^(NSError *error) {
        
    }];
}
-(void)dealGetReceiptWith:(id)responseObject
{
    GetReceiptCardResponse *getReceiptResponse = [GetReceiptCardResponse mj_objectWithKeyValues:responseObject];
    if (getReceiptResponse.response.openBankName.length == 0) {
        return;
    }
    self.rv.bankCardView.hidden = NO;
    self.rv.bankNameLab.text = getReceiptResponse.response.openBankName;
    self.rv.bankCardNumValueLab.text = [AppTools changeCardNum:getReceiptResponse.response.accountNo];
    //传值到修改收款卡
    self.bankPhoneNumStr = getReceiptResponse.response.bankReservedMobile;
    self.bankNameStr = getReceiptResponse.response.openBankName;
//    self.bankCardNumStr = [AppTools changeCardNum:getReceiptResponse.response.accountNo];
    self.bankCardNumStr = getReceiptResponse.response.accountNo;
    self.commMercIdStr = getReceiptResponse.response.commMercId;
    self.bankCodeStr = getReceiptResponse.response.bankId;
    
    
    //根据银行简称匹配颜色
    NSString *bankId = getReceiptResponse.response.bankBackCoulor;
    [self setBankCardBackGroundColor:self.rv.bankCardView bankId:bankId];
    
}
-(void)setBankCardBackGroundColor:(UIView *)view bankId:(NSString *)bankId
{
    view.layer.cornerRadius = 5;
    view.layer.shadowOpacity = 0.5;
    view.layer.shadowRadius = 5;
    view.layer.shadowOffset = CGSizeMake(0, 5);
    
    if ([@"CCB" isEqualToString:bankId]||
        [@"CMBC" isEqualToString:bankId]||
        [@"COMM" isEqualToString:bankId]||
        [@"CIB" isEqualToString:bankId]||
        [@"SPDB" isEqualToString:bankId]||
        [@"1" isEqualToString:bankId]) {
        //蓝色
        view.layer.shadowColor = ETColorWithRGB(94, 154, 255).CGColor;
        [view az_setGradientBackgroundWithColors:@[ETColorWithRGB(88, 160, 255),ETColorWithRGB(100, 147, 255)] locations:nil startPoint:CGPointMake(0,0) endPoint:CGPointMake(1,0)];
    }else if ([@"ABC" isEqualToString:bankId]||
              [@"PSBC" isEqualToString:bankId]||
              [@"3" isEqualToString:bankId])
    {
        //绿色
        view.layer.shadowColor = ETColorWithRGB(57, 192, 206).CGColor;
        [view az_setGradientBackgroundWithColors:@[ETColorWithRGB(66, 210, 205),ETColorWithRGB(48, 173, 206)] locations:nil startPoint:CGPointMake(0,0) endPoint:CGPointMake(1,0)];
    }else if ([@"ICBC" isEqualToString:bankId]||
              [@"BOC" isEqualToString:bankId]||
              [@"CITIC" isEqualToString:bankId]||
              [@"GDB" isEqualToString:bankId]||
              [@"SZPAB" isEqualToString:bankId]||
              [@"CMB" isEqualToString:bankId]||
              [@"0" isEqualToString:bankId])
    {
        //红色
        view.layer.shadowColor = ETColorWithRGB(251, 65, 58).CGColor;
        [view az_setGradientBackgroundWithColors:@[ETColorWithRGB(255, 133, 111),ETColorWithRGB(248, 90, 81)] locations:nil startPoint:CGPointMake(0,0) endPoint:CGPointMake(1,0)];
    }else if ([@"ICBC" isEqualToString:bankId]||
              [@"3" isEqualToString:bankId])
    {
        //紫色
        view.layer.shadowColor = ETColorWithRGB(156, 77, 196).CGColor;
        [view az_setGradientBackgroundWithColors:@[ETColorWithRGB(197, 128, 226),ETColorWithRGB(154, 74, 194)] locations:nil startPoint:CGPointMake(0,0) endPoint:CGPointMake(1,0)];
    }else
    {
        //匹配不到默认色  蓝色
        view.layer.shadowColor = ETColorWithRGB(94, 154, 255).CGColor;
        [view az_setGradientBackgroundWithColors:@[ETColorWithRGB(88, 160, 255),ETColorWithRGB(100, 147, 255)] locations:nil startPoint:CGPointMake(0,0) endPoint:CGPointMake(1,0)];
    }
}


-(void)addNewCard
{
    AddCreditCardViewController *addCreditVC = [[AddCreditCardViewController alloc] init];
    __weak __typeof(self)weakSelf = self;
    //查询支付卡
    addCreditVC.refreshCreditCardBlock = ^{
        NSLog(@"调用查询");
        [weakSelf getCredictCardList];
    };
    [self.navigationController pushViewController:addCreditVC animated:YES];
}

-(void)solveConfict
{
    NSArray *gestureArray = self.navigationController.view.gestureRecognizers;
    
    for (UIGestureRecognizer *gestureRecognizer in gestureArray) {
        
        if ([gestureRecognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) {
            
            [self.scrollView.panGestureRecognizer requireGestureRecognizerToFail:gestureRecognizer];
            
        }
        
    }
}

-(void)createTopView
{
    self.tv = [[TopView alloc] initWithFrame:(CGRectMake(0, 0, self.view.frame.size.width, 54))];
    [self.view addSubview:self.tv];
}
-(void)createreceiptView
{
    self.rv = [[ReceiptCardView alloc] initWithFrame:(CGRectMake(self.view.frame.size.width, 0, self.view.frame.size.width, self.view.frame.size.height - 64 - 54))];
    UITapGestureRecognizer *rvTapgesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rvTapgestureAction)];
    self.rv.bankCardView.userInteractionEnabled = YES;
    [self.rv.bankCardView addGestureRecognizer:rvTapgesture];
    [self.scrollView addSubview:self.rv];
}
-(void)rvTapgestureAction
{
    NSLog(@"点击收款卡");
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
    
    UIAlertAction *changeAction =  [UIAlertAction actionWithTitle:@"修改收款卡" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"点击修改收款卡");
        ChangeReceiptCardViewController *changeVC = [[ChangeReceiptCardViewController alloc] init];
        changeVC.bankCardNumStr = self.bankCardNumStr;
        changeVC.bankNameStr = self.bankNameStr;
        changeVC.bankPhoneNumStr = self.bankPhoneNumStr;
        changeVC.commMercIdStr = self.commMercIdStr;
        changeVC.bankCodeStr = self.bankCodeStr;
         __weak __typeof(self)weakSelf = self;
        //查询收款卡
        changeVC.changeReceiptCardBlock = ^{
            [weakSelf getReceiptCard];
        };
        
        
        [self.navigationController pushViewController:changeVC animated:YES];
        
    }];
    
    UIAlertAction *cancleAction =  [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"点击取消");
    }];
    
    [alertVC addAction:cancleAction];
    [alertVC addAction:changeAction];
    [self presentViewController:alertVC animated:YES completion:nil];
    
    
    
    
}

-(void)createPayCardView
{
    self.mv = [[MyBankCardView alloc] initWithFrame:(CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64 - 54))];
    NSLog(@"%f  %f",self.view.frame.size.height,ETScreenH);
    [self.scrollView addSubview:self.mv];
}

-(void)createScrollView
{
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 54, self.view.frame.size.width, self.view.frame.size.height - 54 - 64)];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.scrollView.showsHorizontalScrollIndicator = NO;
    self.scrollView.showsVerticalScrollIndicator = NO;
    self.scrollView.pagingEnabled = YES;
    self.scrollView.bounces = NO;
    self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width * 2, self.view.frame.size.height - 54 - 64);
    self.scrollView.delegate = self;
    [self.view addSubview:self.scrollView];
    
}

//点击支付卡
-(void)payBtnAction
{
    self.tv.payImv.hidden = NO;
    self.tv.receiptImv.hidden = YES;
    [self.tv.receiptBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.tv.receiptBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    
    [self.tv.payBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.tv.payBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    
    //显示支付卡
    self.scrollView.contentOffset = CGPointMake(0, 0);
}
//点击收款卡
-(void)receiptBtnAction
{
    self.tv.payImv.hidden = YES;
    self.tv.receiptImv.hidden = NO;
    [self.tv.receiptBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.tv.receiptBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    
    [self.tv.payBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.tv.payBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    
    //显示收款卡
    self.scrollView.contentOffset = CGPointMake(self.view.frame.size.width, 0);

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    float offset = scrollView.contentOffset.x;
    NSLog(@"%f",offset);
    if (offset == 0) {
        self.tv.payImv.hidden = NO;
        self.tv.receiptImv.hidden = YES;
        [self.tv.receiptBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
        self.tv.receiptBtn.titleLabel.font = [UIFont systemFontOfSize:16];
        
        [self.tv.payBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
        self.tv.payBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    }else if (offset == self.view.frame.size.width)
    {
        self.tv.payImv.hidden = YES;
        self.tv.receiptImv.hidden = NO;
        [self.tv.receiptBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
        self.tv.receiptBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
        
        [self.tv.payBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
        self.tv.payBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    }
}

-(void)createTableView
{
    //底层View  显示在线申请信用卡
    UIView *contentView = [[UIView alloc] init];
    contentView.frame = CGRectMake(0, 10, ETScreenW, ETScreenH - 54 - 64 - 10);
    contentView.backgroundColor = [UIColor redColor];
    [self.scrollView addSubview:contentView];
    
    
    
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ETScreenW, ETScreenH - 54 - 64 - 10) style:(UITableViewStyleGrouped)];
    self.tableView.backgroundColor = [UIColor whiteColor];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [contentView addSubview:self.tableView];
    self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    [self.tableView registerClass:[MyBankCardTableViewCell class] forCellReuseIdentifier:@"cell"];
    
    
    
    /*
    //增加在线申请信用卡
    self.onlineApplyCreditCardBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.onlineApplyCreditCardBtn setTitle:@"在线申请信用卡>" forState:(UIControlStateNormal)];
    
    [self.onlineApplyCreditCardBtn setTitleColor:ETColorWithRGB(91, 113, 255) forState:(UIControlStateNormal)];
    self.onlineApplyCreditCardBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [contentView addSubview:self.onlineApplyCreditCardBtn];
    [contentView bringSubviewToFront:self.onlineApplyCreditCardBtn];
    
    
    [self.onlineApplyCreditCardBtn addTarget:self action:@selector(onlineApplyCreditCardBtnAction) forControlEvents:(UIControlEventTouchUpInside)];

    [self.onlineApplyCreditCardBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.scrollView);
        make.bottom.equalTo(self.view).offset(-30);
    }];
     */
   
    
}
-(void)onlineApplyCreditCardBtnAction
{
    NSLog(@"点击在线申请信用卡");
    H5TradeViewController *tradeVC = [[H5TradeViewController alloc] init];
    tradeVC.urlStr = [AppTools shareInstance].pagePath;
    [self.navigationController pushViewController:tradeVC animated:YES];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.cardModelArray.count;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
     return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MyBankCardTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (self.cardModelArray.count == 0) {
        self.onlineApplyCreditCardBtn.hidden = NO;
    }
    SelectCreditCardRecord *record = self.cardModelArray[indexPath.row];
    cell.bankNameLab.text = record.bankName;
    cell.bankNumLab.text = [AppTools changeCardNum:record.cardNo];
    //根据银行简称给银行卡赋值颜色
    NSString *banId = record.bankId;
    [self setBankCardBackGroundColor:cell.bankCardView bankId:banId];
    
    
    return cell;
}



-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 140;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.01f;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 80.0f;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    self.addNewCardView = [[AddNewCardView alloc] initWithFrame:CGRectMake(0, 0, ETScreenW, 80)];
    [self.addNewCardView.addCardBtn addTarget:self action:@selector(addNewCard) forControlEvents:(UIControlEventTouchUpInside)];
    self.addNewCardView.backgroundColor = [UIColor clearColor];
    
    if (self.cardModelArray.count > 0) {
        [self.addNewCardView.addCardBtn mas_updateConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.addNewCardView);
        }];
    }
    return self.addNewCardView;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
    
    UIAlertAction *deleteAction =  [UIAlertAction actionWithTitle:@"删除" style:(UIAlertActionStyleDestructive) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"点击删除");
        SelectCreditCardRecord *record = self.cardModelArray[indexPath.row];
        [self deleteCredictCardWithCardNo:record.ID Model:record];
        
    }];
    
    UIAlertAction *cancleAction =  [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"点击取消");
    }];
    
    [alertVC addAction:cancleAction];
    [alertVC addAction:deleteAction];
    [self presentViewController:alertVC animated:YES completion:nil];
}




@end
